const http = require("../../api/index")
const { baseURL } = require("../../utils/request")
Page ({
  goFindCamp2:function(){
    wx.navigateTo({
      url: '/pages/huiyuanfw/huiyuanfw',
    })
  },
  goFindCamp1:function(){
    wx.switchTab({
      url: '/pages/shangchuan/shangchuan',
    })
  },
  goyingdixq:function(){
    wx.navigateTo({
      url: '/pages/yingdixq/yingdixq',
    })
  },
  goFindCamp:function(){
    wx.navigateTo({
      url: '/pages/campMap/campMap',
    })
  },
  goFindCamp1:function(){
    wx.switchTab({
      url: '/pages/shangchuan/shangchuan',
    })
  },

//获取广告列表
bannerList(){
  http.getBannerList().then(res=>{
    if(res.code == 200){
      // let imageList = res.rows.filter(item =>{
      //   return item.state == "1"
      // })
      this.setData({
        swiperList: res.rows
      })
    }
  })
},

/**
 * 生命周期函数--监听页面显示
 */
onShow(){
  http.campList({pageNum:1,pageSize:500}).then(res=>{
    
  })
  this.bannerList()
},


  data:{
    oss_url: baseURL,
    swiperList:[
      {
      id: 1,
      localName: '../../images/static/swiper1.jpg'
    },
    {
      id: 2,
      localName: '../../images/static/swiper2.jpg'
    },
    {
      id: 3,
      localName: '../../images/static/swiper3.jpg'
    }
    ],
    selectCampList:[],
    campList: [  
      {  
        id: 1,  
        name: '老君山营地',  
        location: '河南省洛阳市七里坪村21组',  
        image: '../../images/static/swiper1.jpg' // 图片URL  
      },  
      {  
        id: 2,  
        name: '九寨沟',  
        location: '九寨沟阳光温泉露营地',  
        image: '../../images/static/swiper2.jpg' // 图片URL  
      },  
      {  
        id: 3,  
        name: '石家庄',  
        location: '悠悠春天自然探索营地',  
        image: '../../images/static/swiper3.jpg' // 图片URL  
      },  
    ]  
  }
})